	// 确认提示框
	const showModal = str => {
		return new Promise((resolve, reject) => {
			uni.showModal({
					title: str.title,//标题
					content: str.content,//提示的内容
					showCancel: true, //是否显示取消按钮，默认ture
					success: function(res) {
					if (res.confirm) {
					    // 执行确认后的操作
						setTimeout(() => {
							resolve(res.confirm)
						}, 2000)
					} 
					else {
						// 执行取消后的操作
						setTimeout(() => {
							resolve(res.cancel)
						}, 2000)
					}
				}
			})
		})
	};

// 不含icon提示框
	const toast = str => {
		return new Promise((resolve, reject) => {
			uni.showToast({
				title: str,
				icon: "none",
				duration: 2000,
				success: () => {
					setTimeout(() => {
						resolve
					}, 2000)
				}
			})
		})
	};
	// 成功提示框
	const successToast = str => {
		return new Promise((resolve, reject) => {
			uni.showToast({
				title: str,
				icon: "success",
				duration: 2000,
				success: () => {
					setTimeout(() => {
						resolve()
					}, 2000)
				}
			})
		})
	};
	// loading
	const showLoading = str => {
		return new Promise((resolve, reject) => {
			uni.showLoading({
				title:str,
				success: () => {
					resolve()
				}
			})
		})
	};
	// tipLoading ==>提示loading
	const tipLoading = str => {
		return new Promise((resolve, reject) => {
			uni.showLoading({
				title: str,
				success: () => {
					resolve()
				}
			})
		})
	};
	// 隐藏loading
	const hideLoading = () => {
		return new Promise((resolve, reject) => {
			uni.hideLoading({
				success: () => {
					resolve()
				}
			})
		})
	};
	export default {
		toast: toast,
		successToast: successToast,
		showLoading: showLoading,
		tipLoading: tipLoading,
		hideLoading: hideLoading,
		showModal: showModal,
	}